﻿
@{
    ViewBag.Title = "会员提现";
    Layout = "~/Views/Shared/DetailsInfoLayout.cshtml";
}

@section CSS{
    <link href="~/Content/css/layerui/layui.css" rel="stylesheet" />
    <link href="~/Content/js/UploadImg/css/webuploader.css" rel="stylesheet" />
}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="ibox-content">

                @if (Model != null)
                {
                    if (Model.types == 0)
                    {
                        <form class="form-horizontal" id="from-company" novalidate="novalidate" method="post" action="/Finance/CheckShopBankCard">

                            <div class="form-group">
                                <label class="col-sm-3 control-label">公司名称：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.company_name</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户行：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.bank_name</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">银行开户姓名：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.account_holder</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">银行卡号：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.bank_cardno</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户行地区：</label>
                                <div class="col-sm-9">
                                    <select style="width: 120px;height:30px; " id="selProvice0" name="selProvice" disabled="disabled"><option value="">未知</option><option value="1">北京</option><option value="2">天津</option><option value="3">河北省</option><option value="4">山西省</option><option value="5">内蒙古</option><option value="6">辽宁省</option><option value="7">吉林省</option><option value="8">黑龙江省</option><option value="9">上海</option><option value="10">江苏省</option><option value="11">浙江省</option><option value="12">安徽省</option><option value="13">福建省</option><option value="14">江西省</option><option value="15">山东省</option><option value="16">河南省</option><option value="17">湖北省</option><option value="18">湖南省</option><option value="19">广东省</option><option value="20">广西</option><option value="21">海南省</option><option value="22">重庆</option><option value="23">四川省</option><option value="24">贵州省</option><option value="25">云南省</option><option value="26">西藏自治区</option><option value="27">陕西省</option><option value="28">甘肃省</option><option value="29">青海省</option><option value="30">宁夏</option><option value="31">新疆</option><option value="32">台湾省</option><option value="33">香港</option><option value="34">澳门</option><option value="35">海外</option></select>
                                    <select style="width: 120px; height:30px;display: none;" name="selCity" id="selCity0" disabled="disabled"></select>
                                    <select style="width: 120px; height:30px;display: none;" name="selCounty" id="selCounty0" disabled="disabled"></select>
                                    <span class="help-block m-b-none"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户行支行：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.bank_branch</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户预留手机号 ：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.mobile_number</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户行许可证 ：</label>
                                <div class="col-sm-3">
                                    <div class="layui-upload">
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img" id="company_permission_img0" onclick="javascript:imgzoom(this.id)" style="width: 150px; height: 150px; cursor: pointer">
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-3 control-label">审核状态：</label>
                                <div class="col-sm-9">
                                    @if (Model.status == 0)
                                    {
                                        <select style="width:200px;" name="status" id="status" class="form-control" required="" aria-required="true">
                                            <option value="0">待审核</option>
                                            <option value="1">审核通过</option>
                                            <option value="2">审核失败</option>
                                        </select>
                                    }
                                    else
                                    {
                                        <select style="width:200px;" name="status" id="status" class="form-control" disabled="disabled">
                                            <option value="0">待审核</option>
                                            <option value="1">审核通过</option>
                                            <option value="2">审核失败</option>
                                        </select>
                                    }

                                    <span class="help-block m-b-none"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">备注/拒绝原因：</label>
                                <div class="col-sm-9">
                                    @if (Model.status == 0)
                                    {
                                        <textarea name="remark" id="remark" maxlength="500" class="form-control" placeholder="请输入备注" rows="3">@Model.remark</textarea>
                                    }
                                    else
                                    {
                                        <textarea name="remark" id="remark" maxlength="500" class="form-control" readonly="readonly" placeholder="请输入备注" rows="3">@Model.remark</textarea>
                                    }                            <span class="help-block m-b-none"></span>
                                </div>
                            </div>
                            <input type="hidden" id="id" value="@Model.id" name="id">
                            @if (Model.status == 0)
                            {
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="button" id="btnSave">保存信息</button>
                                    </div>
                                </div>
                            }

                        </form>

                    }
                    else if (Model.types == 1)
                    {
                        <form class="form-horizontal" id="from-person" novalidate="novalidate" method="post" action="/Finance/CheckShopBankCard">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户行名称：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.bank_name</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">持卡人姓名 ：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.account_holder</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">银行卡号 ：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.bank_cardno</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户行地区：</label>
                                <div class="col-sm-9">
                                    <select style="width: 120px;height:30px;" id="selProvice1" name="selProvice" disabled="disabled"><option value="">未知</option><option value="1">北京</option><option value="2">天津</option><option value="3">河北省</option><option value="4">山西省</option><option value="5">内蒙古</option><option value="6">辽宁省</option><option value="7">吉林省</option><option value="8">黑龙江省</option><option value="9">上海</option><option value="10">江苏省</option><option value="11">浙江省</option><option value="12">安徽省</option><option value="13">福建省</option><option value="14">江西省</option><option value="15">山东省</option><option value="16">河南省</option><option value="17">湖北省</option><option value="18">湖南省</option><option value="19">广东省</option><option value="20">广西</option><option value="21">海南省</option><option value="22">重庆</option><option value="23">四川省</option><option value="24">贵州省</option><option value="25">云南省</option><option value="26">西藏自治区</option><option value="27">陕西省</option><option value="28">甘肃省</option><option value="29">青海省</option><option value="30">宁夏</option><option value="31">新疆</option><option value="32">台湾省</option><option value="33">香港</option><option value="34">澳门</option><option value="35">海外</option></select>
                                    <select style="width: 120px;  height:30px;display: none;" name="selCity" id="selCity1" disabled="disabled"></select>
                                    <select style="width: 120px; height:30px; display: none;" name="selCounty" id="selCounty1" disabled="disabled"></select>
                                    <span class="help-block m-b-none"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户行支行：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.bank_branch</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">开户预留手机号 ：</label>
                                <div class="col-sm-9">
                                    <span class="help-block m-b-none">@Model.mobile_number</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">持卡人身份证及授权：</label>

                                <div class="col-sm-3">
                                    <div class="layui-upload">
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img" id="bank_face_card_img" onclick="javascript:imgzoom(this.id)" style="width: 150px; height: 150px; cursor: pointer">
                                        </div>
                                    </div>
                                    <span class="help-block m-b-none">身份证正面</span>
                                </div>
                                <div class="col-sm-3">
                                    <div class="layui-upload">
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img" id="bank_opposite_card_img" onclick="javascript:imgzoom(this.id)" style="width: 150px; height: 150px; cursor: pointer">
                                        </div>
                                    </div>
                                    <span class="help-block m-b-none">身份证反面</span>
                                </div>
                                <div class="col-sm-3">
                                    <div class="layui-upload">
                                        <div class="layui-upload-list">
                                            <img class="layui-upload-img" id="company_permission_img1" onclick="javascript:imgzoom(this.id)" style="width: 150px; height: 150px; cursor: pointer">
                                        </div>
                                    </div>
                                    <span class="help-block m-b-none">公司授权结算账号证明</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">审核状态：</label>
                                <div class="col-sm-9">
                                    @if (Model.status == 0)
                                    {
                                        <select style="width:200px;" name="status" id="status" class="form-control" required="" aria-required="true">
                                            <option value="0">待审核</option>
                                            <option value="1">审核通过</option>
                                            <option value="2">审核失败</option>
                                        </select>
                                    }
                                    else
                                    {
                                        <select style="width:200px;" name="status" id="status" class="form-control" required="" aria-required="true" disabled="disabled">
                                            <option value="0">待审核</option>
                                            <option value="1">审核通过</option>
                                            <option value="2">审核失败</option>
                                        </select>
                                    }
                                    <span class="help-block m-b-none"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-3 control-label">备注/拒绝原因：</label>
                                <div class="col-sm-9">
                                    @if (Model.status == 0)
                                    {
                                        <textarea name="remark" id="remark" maxlength="500" class="form-control" placeholder="请输入备注" rows="3">@Model.remark</textarea>
                                    }
                                    else
                                    {
                                        <textarea name="remark" id="remark" maxlength="500" class="form-control" readonly="readonly" placeholder="请输入备注" rows="3">@Model.remark</textarea>
                                    }
                                    <span class="help-block m-b-none"></span>
                                </div>
                            </div>
                            <input type="hidden" id="id" value="@Model.id" name="id">
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-3">
                                    @if (Model.status == 0)
                                    {
                                        <button class="btn btn-primary" type="button" id="btnSave">保存信息</button>
                                    }
                                </div>
                            </div>
                        </form>

                    }
                }

            </div>
        </div>
    </div>
</section>
@section JS{
    <script src="~/Content/js/jquery.form.js"></script>
    <script src="~/Content/plugins/validate/jquery.validate.min.js"></script>
    <script src="~/Content/plugins/validate/messages_zh.min.js"></script>

    <script type="text/javascript">
         var province=@(Model!=null? Model.bank_province:0);
        var city=@(Model!=null? Model.bank_city : 0);
        var country=@(Model!=null? Model.bank_country : 0);
        var company_permission='@(Model!=null? Model.company_permission : "")';
        var bank_face_card='@(Model!=null? Model.bank_face_card : "")';
        var bank_opposite_card='@(Model!=null? Model.bank_opposite_card : "")';
        var type=@(Model!=null? Model.types : "0");
        var status=@(Model!=null? Model.status : "0");
        $(function(){
        $("#status").val(status);
        if(company_permission!=""){
        if(type==0){
        $("#company_permission_img0").attr('src', domain + company_permission);
        if(province!="0"){
        getprovince(0, "#selProvice0", province);
        }
        if(city!="0"){
        getprovince(province, "#selCity0", city);
        }
        if(country!="0"){
        getprovince(city, "#selCounty0", country);
        }

        }
        else{
         if(province!="0"){
        getprovince(0, "#selProvice1", province);
        }
        if(city!="0"){
        getprovince(province, "#selCity1", city);
        }
        if(country!="0"){
        getprovince(city, "#selCounty1", country);
        }

        $("#company_permission_img1").attr('src', domain + company_permission);
        if(bank_face_card!=""){
          $("#bank_face_card_img").attr('src', domain + bank_face_card);
        }
         if(bank_opposite_card!=""){
          $("#bank_opposite_card_img").attr('src', domain + bank_opposite_card);
        }
        }
        }
        $("#btnSave").click(function(){
        var id=$("#id").val();
        var status=$("#status").val();
         var remark=$("#remark").val();
            $.ajax({
                type: "post",
                url: "/Finance/CheckShopBankCard",
                dataType: "json",
                data: { id: id, status: status, remark: remark },
        success: function (data) {
            if (data.status == "y") {
                parent.layer.msg("操作成功", { time: 1200 }, function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.location.replace(parent.location.href);
                    parent.layer.close(index);
                });
            }
            else {
                parent.layer.msg(data.info, { time: 2000 });
                flag = true;
            }
        }
    });
            });
        });
        function getprovince(id, obj, sid) {
            ajax("/tools/GetPrivoceList/" + id, {}, function (data) {
                var ui = "<option value=''>请选择</option>";
                $.each(data, function (row, value) {
                    ui += "<option value='" + value.id + "'>" + value.name + "</option>";
                })
                $(obj).html(ui);
                $(obj).show();
                if (sid != undefined && sid != '')
                    $(obj).val(sid);
            })
        }

        //图片点击跳转
        function imgzoom(obj) {
            var img = document.getElementById(obj).src
            if (!!img) {
                onclick = window.open(img)
            }
        }
    </script>
}

